ADFA-5048 (3/5): Split the region analysis primitives into one file per concern - #1819
Conversation
The three concerns extract method's analysis needs before it can derive a signature, each independent of the others and of the plan model: - AnchorMember.kt - the class member the new method becomes a sibling of. "Nearest ancestor that is a direct member of a ClassTree" covers method, constructor, initializer and field uniformly, and decides `static`. - RegionReferences.kt - what the region names: every identifier in source order, which of those are locals declared inside the anchor but outside the region (the future parameters), and whether the region reassigns one it does not declare. - RegionTypes.kt - rendering a type as source, shortened only where the file already resolves the short form, plus the two shapes that cannot be written out: a local or anonymous class, and a type variable owned by the anchor. Split into three files rather than one because they only meet in the entry point that follows, and 1000 lines in one file is not reviewable. No caller yet; the analysis that uses them lands next.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (3)
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📝 Summary
WalkthroughAdded Java refactoring utilities to resolve enclosing members, analyze captured references and mutations, detect relevant type constructs, and render resolvable type names for extraction regions. ChangesJava refactoring analysis
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to This change reorganizes existing region-analysis code into separate files without changing behavior or callers, and the affected module compiles successfully. It is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit reads each line, Comment |
Stack 3 of 5 for ADFA-5048. Base: #1818. Mechanical split, no logic change; no caller until PR 4.
Splits the analysis primitives out of what would otherwise be a single 1000-line file, one file per concern, where a concern is a set of functions that only meet at the entry point:
AnchorMember.kt- where the new declaration goes, and whether it must be static.RegionReferences.kt- what the region names, which of those are captures, and what it reassigns.RegionTypes.kt- rendering a type as source, and the shapes that cannot be written out.The functions are moved verbatim by a block parser rather than retyped, so no comment is orphaned and no import dropped.
privatewas promoted tointernalonly for the symbols now referenced across a file boundary;isStaticMemberandMAX_TYPE_DEPTHstayed private.This branch compiles on its own (
:lsp:java:compileV8DebugKotlin), which is the point of cutting here.